<?php
/**
 * Created by PhpStorm.
 * User: dubox
 * Date: 4/19/17
 * Time: 10:29 AM
 */


$access_token_url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wxce2e5760d486ad36&secret=aa462c6321d9b776e20da7ba77c2bbdb';
$result = file_get_contents($access_token_url);var_dump($result);

$access_token = json_decode($result ,true)['access_token'];

$jsapi_ticket_url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=$access_token&type=jsapi";

$result = file_get_contents($jsapi_ticket_url);var_dump($result);

echo $access_token = json_decode($result ,true)['ticket'];